package com.jeremy.entity;

import java.io.Serializable;
import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

public class User implements Serializable{

	private static final long serialVersionUID = 383922430025539250L;
	
	private Long id;
	private String name;
	private String sex;
	private String age;
	//通过注解进行转换
    @DateTimeFormat(pattern="yyyy-MM-dd")//在表单提交时，将字符串转换为指定date格式
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")//后台数据库=》前端date数据格式化
	private Date birthdate;
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public String getAge() {
		return age;
	}
	public void setAge(String age) {
		this.age = age;
	}
	public Date getBirthdate() {
		return birthdate;
	}
	public void setBirthdate(Date birthdate) {
		this.birthdate = birthdate;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	@Override
	public String toString() {
		return "User [id=" + id + ", name=" + name + ", sex=" + sex + ", age=" + age + ", birthdate=" + birthdate + "]";
	}
	
}
